import Cookies from "js-cookie";
const TokenKey = "Oj-c-Token";

export function getToken() {
  return Cookies.get(TokenKey);
}

export function setToken(token) {
  return Cookies.set(TokenKey, token, {
    path: '/',       // 确保Cookie在整个站点可用
    sameSite: 'Lax', // 适当的SameSite设置
    expires: 7       // 设置过期时间，例如7天
  });
}

export function removeToken() {
  return Cookies.remove(TokenKey);
}